#include <QtCore/QCoreApplication>
#include <lzw.h>
#include <qfile.h>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);


    printf("Let's begin!!!\n");

    QFile inFile;
    QFile outFile;
    LZW arch;

    inFile.setFileName("5.txt");
    outFile.setFileName("6.txt");

    printf("%s\n","Choose the operation");
    printf("%s\n","1) Compress file");
    printf("%s\n","2) Decompress file");


    char c;
    while(1)
    {
        c=getchar();
        switch (c)
        {
        case '1':

                  arch.CompressFile(inFile.fileName(), outFile.fileName());
                  break;

        case '2':

                  arch.DecompressFile("6.txt","7.txt");
                  break;
        default:

                  printf("\nExiting.... Press any key");
                  getchar();
                  return 0;
                  break;

         }
    }

    return 0;
    //return a.exec();
   // a.exit(0);

}

